package com.hspedu.properties;


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * @Author Stringzhua
 * @Date 2024/3/17 19:32
 * description:
 */
public class Perperites_ {
    public static void main(String[] args) throws IOException {
        //读取mysql.properties配置文件,并得到ip, user和pwd
        BufferedReader br = new BufferedReader(new FileReader("chapter19/src/com/hspedu/mysql.properties"));
        String line = "";
        while ((line = br.readLine()) != null) {
            //循环读取
            String[] split = line.split("=");
            //如果我们要求指定的ip值
            if ("ip".equals(split[0])) {
                System.out.println(split[0] + "值是:" + split[1]);
            }
        }
        br.close();
    }
}
//E:\qiyeke\javabasic\chapter19\src\com\hspedu\mysql.properties